package com.hujesse.service.menu;

import com.hujesse.dao.menu.MenuDao;
import com.hujesse.pojo.MainMenu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class MenuServiceImpl implements MenuService{
    @Autowired
    private MenuDao menuDao;
    @Override
    public Map<String, Object> getMenus() {
        Map<String, Object> map = new HashMap<>();
        List<MainMenu> menus = menuDao.getMenus();
        if (null!=menus){
            map.put("menus",menus);
            map.put("flag",200);
        }else {
            map.put("flag",400);
        }
        return map;
    }
}
